// Text of project WordArray written on 11/21/95 at 6:32 PM
// Beginning of file WordArray Layout

// Before Script for "_view000"
// Copyright 1993-1995 Apple Computer, Inc. All rights reserved.


_view000 :=
    {title: "WordArray",
     viewBounds: {left: 0, top: 2, right: 236, bottom: 326},
     viewFormat: 83951953,
     viewSetupFormScript:
       func()
       begin
       	local b := GetAppParams();
       	constant kMaxWidth := 240;
       	constant kMaxHeight := 336;
       	
       	viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop,
       							Min(b.appAreaWidth, kMaxWidth),
       							Min(b.appAreaHeight, kMaxHeight) );
       end,
     _proto: @157
    };

instructions :=
    {viewFlags: 1,
     viewFormat: 257,
     viewLineSpacing: 10,
     viewFont: simpleFont9,
     viewBounds: {left: 24, top: 24, right: 216, bottom: 72},
     text:
       "Write somewhere below this text. In the viewWordScript, the GetWordArray() and GetScoresArray() functions retrieve the recognition information: words and their 'confidence scores' (lower is better)"
     ,
     debug: "instructions",
     viewClass: 81
    };
AddStepForm(_view000, instructions);



writeHere :=
    {viewFlags: 114177,
     viewFormat: 8528,
     viewBounds: {left: 2, top: 80, right: 238, bottom: 300},
     viewWordScript:
       func(unit)
       begin
       	ourWords := GetWordArray(unit);		// list of likely words
       	ourScores := GetScoreArray(unit);	// list of 'confidence' scores
       
       	:Dirty();	// clear our view and eventually redraw our new words 
       
       	true;	//This should return TRUE if you handled the word
       end,
     ourWords: nil,
     viewDrawScript:
       func()
       begin
       	local item, index;
       	local vertical := 0;
       	
       	if ourWords then
       		foreach index, item in ourWords do
       		begin
       			:DrawShape(MakeText(item && ":  " && ourScores[index], 10, vertical, 200, vertical + 20), nil);
       			vertical := vertical + 20;
       		end;
       
       end,
     ourScores: nil,
     viewLineSpacing: 20,
     debug: "writeHere",
     viewClass: 74
    };
AddStepForm(_view000, writeHere);




constant |layout_WordArray Layout| := _view000;
// End of file WordArray Layout



